import RenderAuthorized from '@/components/Authorized';
import { getAuthority } from './authority';
import { getUserInfo } from './user';

let Authorized = RenderAuthorized((getUserInfo() || {}).isAdmin ? ['admin'] : []); // eslint-disable-line

// Reload the rights component
const reloadAuthorized = () => {
  Authorized = RenderAuthorized((getUserInfo() || {}).isAdmin ? ['admin'] : []);
};

export { reloadAuthorized };
export default Authorized;
